home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sea_window.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  62 lines

  1. # Jones 3D Cog Script
  2. #
  3. # sea_window.cog 
  4. #  [JWC & DS]
  5. #
  6. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  7. # ========================================================================================
  8.  
  9. symbols
  10.     
  11.     message     startup
  12.     message     damaged
  13.     
  14.     surface     insidewindow    mask=0x408        
  15.     surface    outsidewindow    mask=0x408    
  16.     
  17.     sound        shatter=shs_glassbreak.wav    local
  18.     template    shards=iceshrapa            local
  19.     thing        player                local
  20.     thing        shardpos                local
  21.     int        broken=0                local
  22.     template    glass=ghost                local
  23.  
  24. end
  25.  
  26. # ========================================================================================
  27.  
  28. code
  29.  
  30. startup:
  31.     sleep(0.01);
  32.     player = GetLocalPlayerThing();
  33.     shardpos = CreateThingAtPos(glass, GetSurfaceSector(insidewindow), GetSurfaceCenter(insidewindow), VectorSet(0, 0, 0));
  34.     CaptureThing(shardpos);
  35.     return;
  36.     
  37. # ========================================================================================
  38.  
  39. damaged:
  40.     If((GetSenderRef() == insidewindow) || (GetSenderRef() == outsidewindow))
  41.         {
  42.         if(broken == 0)
  43.         {
  44.             broken=1;
  45.             PlaySoundLocal(shatter, 1.0, 0, 0, 0);
  46.  
  47.             # Make stuff
  48.             CreateThing(shards, shardpos);
  49.  
  50.             # Swap Texture
  51.             SetWallCel(insidewindow, 1);
  52.             SetWallCel(outsidewindow, 1);
  53.         }
  54.     }
  55.     return;
  56.  
  57. # ========================================================================================
  58.  
  59. end
  60.  
  61.